<%@page import="com.mvc.config.ApplicationConfig"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/pages/common/header.jsp"%>
<jdf:themeFile file="jquery.jqGrid.css"/>
<jdf:themeFile file="jqGrid/i18n/grid.locale-cn.js" />
<jdf:themeFile file="jqGrid/jquery.jqGrid.src.js" />
<jdf:themeFile file="fileuploader.css" />
<jdf:themeFile file="fileuploader.js" />
<jdf:themeFile file="business/sample.js" />
</head>
<body>
	<div class="contentBody contentborder">
		<div class="tab-pane" id="tabPane">
			<div id="message">${message}</div>
			<div class="tab-page" id="tabPage1">
				<h1 class="tab">快递发票管理</h1>
				<div class="contentborder tableForm">
					<jdf:form bean="entity" scope="request">
						<form action="${dynamicDomain}/sample/save" method="post" id="Order">
							<input type="hidden" name="id">
							<input type="hidden" name="objectId">
							<input type="hidden" name="invoiceDate">
							<table class="inputTable">
							     <tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="customerId">客户：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                        <input type="hidden" name="customerId" id="customerId" validate="true">
                                        <input type="text" id="customerName" value="${entity.customer.name}" size="70" readonly="readonly"/>
                                        <c:if test="${view!=1}">
                                        <a href="${dynamicDomain}/customer/select?ajax=1&action=${action}" class="colorbox">选择客户</a>
                                        </c:if>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="companyId">所属公司：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                        <input type="hidden" name="companyId" id="companyId" validate="true">
                                        <input type="text" id="companyName" value="${entity.company.name}" size="70" readonly="readonly"/>
                                        <c:if test="${view!=1}">
                                        <a href="${dynamicDomain}/company/select?ajax=1" class="colorbox">选择公司</a>
                                        </c:if>
                                    </td>
                                </tr>
							    <tr>
									<td class="label cancelBorderLeft" style="width: 200px;">
										<label for="orderId">订单：</label>
									</td>
									<td class="content" colspan="3">
										<input type="hidden" name="orderId" id="orderId" validate="true">
										<input type="text" name="orderNo" id="orderNo" size="70" readonly="readonly" />
										<a href="${dynamicDomain}/order/selectToPacking?ajax=1&keepThis=true&TB_iframe=true&height=460&width=700" class="colorbox">选择订单</a>
									</td>
								</tr>
								<tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="unitPrice">单价：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="unitPrice">
                                    </td>
                                    <td class="label">
                                        <label for="weight">重量：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="weight">
                                    </td>
								</tr>
								<tr>
								    <td class="label cancelBorderLeft">
                                        <label for="amount">总计：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="amount">
                                    </td>
								    <td class="label">
                                        <label for="currency">币种：</label>
                                    </td>
                                    <td class="content">
                                        <select name="currency">
                                            <option value=""></option>
                                            <jdf:select dictionaryId="1006"/>
                                        </select>
                                    </td>
								</tr>
								<tr>
                                    <td class="label cancelBorderLeft">
										<label for="reason">出口原因：</label>
									</td>
									<td class="content" colspan="3">
									    <textarea rows="3" cols="50" name="reason"></textarea>
									</td>
								</tr>
								<tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="shipItem">备注：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                        <textarea rows="3" cols="50" name="shipItem"></textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="courierId">快递公司：</label>
                                    </td>
                                    <td class="content">
                                         <select name="courierId">
                                            <option value=""></option>
                                            <jdf:selectCollection items="couriers" optionText="name" optionValue="objectId"/>
                                        </select>
                                    </td>
                                    <td class="label">
                                        <label for="courierNo">快递单号：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="courierNo">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="label cancelBorderLeft">
                                        <label for="signatureUser">签名：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                        <input type="text" name="signatureUser">
                                    </td>
                                </tr>
								<tr>
									<td class="label cancelBorderLeft">
										<label for="remark">备注：</label>
									</td>
									<td class="content" colspan="3">
										<textarea rows="3" cols="50" name="remark"></textarea>
									</td>
								</tr>
							</table>
						</form>
					</jdf:form>
					<div style="margin: 1px;">
                        <table id="orderItemsTable"></table>
                        <div id="pager"></div>
                    </div>
                    <div class="right" style="margin: 2px;width: 100%;">
                       <div id="filelimit-fine-uploader">
                       </div>
                       <c:forEach varStatus="num" var="item" items="${entity.pictures}">
                           <div id="d_f_${item.fileId}" style="float: left;width: 200px;">
                               <a href="${dynamicDomain}/download/${item.fileId}${item.fileSuffix}" class="picture" title="${item.fileName}">
                                   <img alt="${item.fileName}" alt="${item.fileName}" src="${dynamicDomain}/download/${item.fileId}${item.fileSuffix}" width="150">
                               </a>
                               <a href="javascript:deletePicture('${item.fileId}')" style="vertical-align: top;">删除</a>
                           </div>
                       </c:forEach>
                    </div>
                    <div class="right" style="margin: 2px;">
                        <button type="button" onclick="$('#status').val(10);$('#Order').submit();" class="submit_button">提交</button>
                        <c:if test="${not empty message}">
                        <button type="button" onclick="toUrl('${dynamicDomain}/sample/create?action=${param.action}')">继续增加</button>
                        </c:if>
                        <button type="button" onclick="toUrl('${dynamicDomain}/sample/back')">返回</button>
                    </div>
				</div>
			</div>
		</div>
	</div>
	<jdf:tableLabelValidate domain="Sample"/>
	<script type="text/javascript">
	var sampleId = "${entity.objectId}";	   
	var sampleFileCount = ${fn:length(entity.pictures)};
	var units = "";
    <c:forEach varStatus="num" var="item" items="${units}">
    units+="${item.value}:${item.name};";
    </c:forEach>
    units=units.substring(0,units.length-1);
    
	window.onload = createUploader; 
	</script>
</body>
</html>